function show_tab (tab) {
  $('.all-tabs ol').append('<li>' + tab['title'] + '<br/>' + tab['url'] + '</li>');
}
$(document).ready(function() {
  var text = 'HELLO WORLD';
  chrome.tabs.getAllInWindow(function(tabs) {
    // console.log(tabs);
    for (var i in tabs) {
      var tab = tabs[i];
      // console.log(tab);
      if (tab['url'].startsWith('chrome://')) {
        continue;
      }
      // chrome.tabs.captureVisibleTab({'format': 'jpg'});
      // console.log('<li>' + tab['title'] + '<br/>' + tab['url'] + '</li>');
      show_tab(tab);
    }
  });
  $("#copybtn").zclip({
    path: 'js/ZeroClipboard.swf',
    copy: function(){ return text; },
    afterCopy: function(){ alert('OK'); }
  });
});